#include "namedPipe.hpp"

int main()
{
    NamedPipe fifo(comm_path, Creater);
    if (fifo.OpenForRead())
    {
        std::cout << "Server open named pipe done" << std::endl;
        std::string s;
        while (1)
        {
            int n=fifo.ReadNamePipe(&s);
            if(n>0) std::cout << "[Server]:"<< s << std::endl;
            else if(n==0)
            {
                std::cout<<"Client quit, Server Too!"<<std::endl;
                break;
            }
            else 
            {
                std::cout<<"fifo.ReadNamedPipe Error!"<<std::endl;
                break;
            }
        }
    }
    return 0;
}